<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of tidsplanController
 *
 * @author Admin
 */
class Home_TidsplanController extends Zend_Controller_Action {
    
    public function init() {
        /* Initialize action controller here */
    }

    public function preDispatch() {
        $auth = Zend_Auth::getInstance();
        if (!$auth->hasIdentity()) {
            $this->_redirect('/user/login');
        }

        $view = new Zend_View();
        $view->headTitle(' > Planning > Cabinet');
        $this->view->userDetail = $auth->getIdentity();
    }
    
    public function indexAction(){
        $cabinetModel = new Application_Model_CabinetModel();
        $form = new Application_Form_cabinet_TidsForm();
        
        $cabinets = $cabinetModel->getCabinetProgeress($this->_request);
        
        $this->view->form = $form;
        $this->view->paginator = $cabinets;
        
    }
    
    public function listAction(){
        $this->_helper->layout->disableLayout();
        $id = $this->_request->getParam('id');
        
        $cabinetModel = new Application_Model_CabinetModel();                
        $cabinets = $cabinetModel->getCabinetProgeress($this->_request,$id);        
        
        $this->view->id = $id;
        $this->view->paginator = $cabinets;
    }
}